<template>
  	 <div class="index_user_evelate">
            <div class="aui-tab" id="tab">
                <div class="aui-tab-item" @click="ChangeTab(0)" :class="tabindex==0 && 'aui-active' ">用户评论</div>
                <div class="aui-tab-item"  @click="ChangeTab(1)" :class="tabindex==1 && 'aui-active' ">加盟动态</div>
            </div>
            <div class="index_evelate_box" >
                <div class="index_evelate_con" id="index_evelate_con" v-show="this.tabindex == 0">
                    <ul class="index_evelate_con_lists">
                        <li v-for="(item,index) in evelate">
                            <div class="user_header_pic" v-if="item.member_info.picurl!==''"><img :src="item.member_info.picurl" width="100%" alt="图片加载失败"></div>
                            <div class="user_header_pic" v-else><img src="./../../../assets/images/userheader.png" width="100%" alt="图片加载失败"></div>
                            <div class="index_evelate_con_r">
                                <div class="index_evelate_con_r_t"><span>{{item.member_info.nickname}}</span><span class="goods_type">{{item.order_type_str}}</span></div>
                                <div class="index_evelate_con_r_b">
                                    {{item.content}}
                                    <!-- <div class="index_evelate_con_img_box">
                                        <div class="index_evelate_con_r_b_b"><img src="./../../../assets/images/index_pic_05.jpg" alt="" width="80" height="80"></div>
                                        <div class="index_evelate_con_r_b_b"><img src="./../../../assets/images/index_pic_05.jpg" alt="" width="80" height="80"></div>
                                        <div class="index_evelate_con_r_b_b"><img src="./../../../assets/images/index_pic_05.jpg" alt="" width="80" height="80"></div>
                                    </div> -->
                                </div>
                                <div class="index_evelate_con_date">
                                    {{item.evalatedate}}
                                </div>
                                <div class="sailer_replay" v-if = "item.reply!==null"><span>商家回复：</span>{{item.reply}}</div>
                            </div>
                        </li>
                    </ul>
                    <div v-if="evelate==''" style="text-align: center;line-height: 30px;font-size: 14px;padding-top: 30px;">
                        <div><img src="./../../../assets/images/nolist.png" alt="" width="30%"></div>    
                    </div>
                </div>
                <div class="index_joinus_con" id="index_joinus_con" v-show="this.tabindex == 1">
                    <div class="index_joinus_con_lists" v-for="(item,index) in joinus" @click="openJoinus(item.id)">
<!--                           <router-link :to="{name:'JoinUs'}"> -->
                            <div class="index_joinus_con_title">{{item.title}}</div>
                            <div class="index_joinus_con_detail">
                                <img :src="item.picurl" alt="图片加载失败">
                            </div>
                            <p class="index_joinus_con_lists_b"><span>{{evalateTotal}}评论</span><span>{{updatetime}}</span></p>
<!--                           </router-link> -->
                    </div>
                    <div v-if="joinus==''" style="text-align: center;font-size: 14px;padding-top: 30px;">
                        <div><img src="./../../../assets/images/nolist.png" alt="" width="30%"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</template>
<script>
import { loadComment, loadJoinUs } from '@/api/allapis'
export default{
  name: 'HomeTab',
  data:function(){
  	return {
  		tabindex:0,
  		evelate:[],//评价列表
	    joinus:[],//加盟动态列表
      currenpage:'1',//当前页数
      rows:'5',//当前加载条数 
      limit:'10'//评论当前限制条数      
    }
  }, 
  mounted(){
      this.getData()
  },
  methods:{
    getData() {
        // alert(this.listQuery)
        loadComment(this.limit).then(response => {
          // this.pages = response.data.totalpages
          // console.log(response.data)
          this.evelate = response.data.list
          // this.listLoading = false
        })
        loadJoinUs(this.currenpage,this.rows).then(response => {
          // this.pages = response.data.totalpages
          // console.log(response.data)
          this.joinus = response.data.list
          // this.listLoading = false
        })
    },
    openJoinus(id){
      this.$router.push({
        path:`/joinus/${id}`,
      })
    },
  	ChangeTab:function(index){
  		this.tabindex = index;

  	},
  }
 
}
</script>
<style>

</style>


